package com.own.business.message.center.entity.bo;

import com.own.business.message.center.entity.po.MessageCenterGroup;
import com.own.component.common.base.entity.BaseBo;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * MessageCenterGroupBo
 *
 * @author chenxueli
 * @date 2023-11-13 14:39:27
 */
@Schema(title = "消息中心分组" + ConstantBeanSuffix.BO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class MessageCenterGroupBo extends BaseBo<MessageCenterGroup> implements Serializable {

    /**
     * 封面
     */
    private String cover;

    /**
     * 图标
     */
    private String icon;

    /**
     * 选中的图标
     */
    private String selectedIcon;

    /**
     * 分组key
     */
    private String groupKey;

    /**
     * 类型名称
     */
    private String name;

    /**
     * 是否显示（0=不显示 1=显示）
     */
    private Integer isShow;

    /**
     * 转持久化对象
     *
     * @param entity 原持久化对象
     * @return 持久化对象
     */
    @Override
    public MessageCenterGroup toPo(MessageCenterGroup entity) {
        if (entity == null) {
            entity = new MessageCenterGroup();
        }
        entity.setCover(this.cover);
        entity.setGroupKey(this.groupKey);
        entity.setName(this.name);
        entity.setIsShow(this.isShow);
        entity.setIcon(this.icon);
        entity.setSelectedIcon(this.selectedIcon);
        return super.toPo(entity);
    }

}

